"includeMetadata": true
to your request to
query token metadata for any ERC721 or ERC1155 contract. See below how to fetch
token metadata directly.GetTokenMetadata
Method:
chainID
(string) — the chain id, as a name or number (ie. “1” or “mainnet”, “137” or “polygon”, etc.)contractAddress
(string) — the contract addresstokenIDs
(array of strings) — array of strings containing token ids to fetch metadataGetTokenMetadata
of some tokens using an AQAAAAAAAF_JvPALhBthL7VGn6jV0YDqaFY
enqueueTokensForRefresh
Method:
chainID
(string) — the chain id, as a name or number (ie. “1” or “mainnet”, “137” or “polygon”, etc.)contractAddress
(string) — the contract addresstokenIDs
(array of strings) — array of strings containing token ids to fetch metadatagetTokenRefreshStatus
Method:
taskId
(uint) — the task id returned from enqueueTokensForRefresh
tokenURI(uint256) string
. When querying the tokenURI
method on the contract, it will return a URI which contains additional metadata for that asset.
See EIP for specific details: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md
Here is an example Bored Ape (token id 9)
response:
{ "trait_type": string, "value: string }
.
Additionally, see OpenSea for more information: https://docs.opensea.io/docs/metadata-standards
Note that OpenSea technically breaks the ERC1155 standard by suggesting to use “attributes”, where in fact,
the ERC1155 calls uses the field name “properties” instead of “attributes”, see
https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1155.md#erc-1155-metadata-uri-json-schema (read section below).
However this is completely okay and mixed use of properties / attributes is compatible in practice.
On Sequence Metadata, we support both structures for token contracts which use either format for their properties/attributes.
Another example is from Neon District
uri(uint256) string
. When querying the uri
method on the
contract, it will return a URI which contains additional metadata for that asset.
See EIP for specific details: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1155.md#erc-1155-metadata-uri-json-schema
Here is an example Skyweaver card (token id 65548)
properties
object, which is an object/dictionary type of arbitrary data.
attributes
and properties
. The attributes
field is an array of
objects. The properties
field is an object/dictionary of arbitrary data. In technical terms, the attributes
type is defined as
[]map<string,any>
and the properties
type is defined as map<string,any>
.
In practice, we’ve seen that many projects use both attributes
and properties
to store the same data, and in some cases, they use
attributes
to store data that should be in properties
and vice versa. Sometimes project use both fields, and this is completely fine
in practice, as marketplaces and services will parse both areas.
Finally, if you are looking to extend the metadata format to suit your project, we recommend to utilize either or both the attributes
and properties
fields for either ERC721 or ERC1155.
name
and decimals
. Additionally, ERC20 tokens can take advantage of the contractURI
extension used
by OpenSea and described in more detail in our Contract metadata section.